<?php
defined('G_G_LIN') or die("URL is error");
// 51链接Tool(工具) 类
class ToolAction extends CommonAction {
	
	/**google PR 查询*/
	public function tool_pr(){
		if($_POST['dosubmit'] == 1){
			$domain = strval($_POST['domain']);
			if($domain){
				$domain = strtolower($domain);
				$domain = str_replace('http://' , '' , $domain);
				$url = 'http://www.'.$domain;
				$rs = checkPagerank($url);

				$this->assign('domain' , $domain );
				$this->assign('site_pr' , $rs );
				$this->assign('dosubmit' , $_POST['dosubmit']);
			}
		}
		$this->assign('title', 'Google PR 查询 - 友情链接 - '.C('site_name') );
		$this->assign('keywords', 'Google PR 查询,PR查询,google pagerank 查询'.C('site_name') );
		$this->assign('description', 'Google PR 查询,PR查询,google pagerank 查询'.C('site_name') );
		$this->display();
	}

	/** Alexa排名查询 */
	public function tool_alexa(){
		if($_POST['dosubmit'] == 1){
			$domain = strval($_POST['domain']);
			if($domain){
				$domain = strtolower($domain);
				$domain = str_replace('http://' , '' , $domain);
				$data = checkAlexaRank($domain , 1 ,false);
				$this->assign('domain' , $domain );
				$this->assign('site_alexa' , $data );
				$this->assign('dosubmit' , $_POST['dosubmit']);
			}
		}
		$this->assign('title', 'Alexa排名查询 - 友情链接 - '.C('site_name') );
		$this->assign('keywords', 'Alexa排名查询,Alexa排名,网站排名查询,网站Alexa排名查询,'.C('site_name') );
		$this->assign('description', 'Alexa排名查询,Alexa排名,网站排名查询,网站Alexa排名查询,'.C('site_name') );
		$this->display();
	}

	/** 压缩短网址 */
	public function tool_alink(){
		$this->assign('title', '压缩网址 - 新浪短网址 - google短网址 - '.C('site_name') );
		$this->assign('keywords', '压缩网址,网址减肥,新浪短网址,新浪短网址生成器,google短网址,google短网址生成器,'.C('site_name') );
		$this->assign('description', '压缩网址,网址减肥,新浪短网址,新浪短网址生成器,google短网址,google短网址生成器,'.C('site_name') );
		$this->display();
	}

}